package com.api.user.service.impl;

import com.api.user.dao.PackageCoinMapper;
import com.api.user.model.PackageCoin;
import com.api.user.service.PackageCoinService;
import com.api.core.service.AbstractService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

import com.api.common.JSONUtils;
import com.api.core.response.Result;
import com.api.core.response.ResultGenerator;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

/**
 * Created by wanghuiwen on 2021/04/08.
 */
@Service
@Transactional
public class PackageCoinServiceImpl extends AbstractService<PackageCoin> implements PackageCoinService {
    @Resource
    private PackageCoinMapper packageCoinMapper;

    @Override
    public Result list(Integer page, Integer size){
        PageHelper.startPage(page, size);
        List<Map<String, Object>> res = packageCoinMapper.list();
        PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(res);
        return ResultGenerator.genSuccessResult(pageInfo);
    }
}
